dict = {
    "你好": "hello",
    "nice": "好的"
}

print("nice" in dict)

del dict['你好']
print(dict)

# 新增
dict['你好'] = 'hello1'
print(dict)

# 修改
dict['你好'] = 'hello11'
print(dict)

# 2.字典视图操作 keys() 获取所有key, values() 获取所有value items() 获取字典中所有的key,value对

print(dict.keys())

print(dict.values())

print(dict.items())

for item in dict:
    print(item)
    print(dict[item])

# 3.字典生成式

l1 = ['a', 'b', 'c']
l2 = ['1', '2', '3']
d1 = {key: value for key, value in zip(l1, l2)}
print(d1)
